package dfl.bysj.controller;


import dfl.bysj.entity.Floor;
import dfl.bysj.handler.NoAuth;
import dfl.bysj.result.R;
import dfl.bysj.service.FloorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author DFL
 * @since 2022-04-26
 */
@RestController
@RequestMapping("/floor")
public class FloorController {
    FloorService floorService;

    RedisTemplate redisTemplate;

    @Autowired
    public void setRedisTemplate(RedisTemplate redisTemplate) {
        this.redisTemplate = redisTemplate;
    }

    @Autowired
    public void setFloorService(FloorService floorService) {
        this.floorService = floorService;
    }

    @NoAuth
    @GetMapping("/list")
    public R list(){

        return R.ok().data("floorList",floorService.getAllFloors());
    }
}

